package com.caxxb.service.impl;

import com.caxxb.dao.GameDao;
import com.caxxb.dao.impl.GameDaoImpl;
import com.caxxb.entity.Game;
import com.caxxb.service.GameService;
import com.caxxb.util.PageData;

import java.time.LocalDate;
import java.util.List;

public class GameServiceImpl implements GameService {

    private GameDao gameDao=new GameDaoImpl();

    @Override
    public List<Game> getGameById(int id) {
        return gameDao.getGameById(id);
    }

    @Override
    public PageData<Game> getGamePages(int typeid,String keywords, int pageNo, int pageSize) {
        return gameDao.getGamePages(typeid,keywords, pageNo, pageSize);
    }

    @Override
    public boolean addSales(int id) {
        return gameDao.addSales(id);
    }

    @Override
    public boolean delSales(int id) {
        return gameDao.delSales(id);
    }

    @Override
    public List<Game> getGames() {
        return gameDao.getGames();
    }

    @Override
    public boolean addGame(String game_name, Double price, String game_developer, LocalDate release_time, String game_img, int typeid) {
        return gameDao.addGame(game_name, price, game_developer, release_time, game_img, typeid);
    }

    @Override
    public List getFireImg() {
        return gameDao.getFireImg();
    }

    @Override
    public List getNewlImg() {
        return gameDao.getNewlImg();
    }

    @Override
    public PageData<Game> getGame(String keywords,int pageNo,int pageSize){
        return gameDao.getGame(keywords, pageNo, pageSize);
    }

    @Override
    public boolean updateGame(int game_id, Game game){
        return gameDao.updateGame(game_id, game);
    }

    @Override
    public boolean delGame(int game_id){
        return gameDao.delGame(game_id);
    }

}
